#include "databasectl.h"
#include <stdio.h>

int main(int argc, char *argv[])
{
	struct mem_info mem = {
	.mem_no = 100,
	.name = "huangdajun",
	.passwd = "123456",
	};
	char *buf;
	//add_user(&mem);

	if(0 < select_table_byname("huangdajun",&mem))

	printf("%d,%s,%s,%s,%s,%d,%d,%d,%d\n",mem.mem_no,mem.name,mem.passwd,mem.address,mem.phone,mem.permission,mem.age,mem.msg_flag,mem.salary);


	if(0 < select_table_byname("huangjun",&mem))
	printf("%d,%s,%s,%s,%s,%d,%d,%d,%d\n",mem.mem_no,mem.name,mem.passwd,mem.address,mem.phone,mem.permission,mem.age,mem.msg_flag,mem.salary);

	modify_table("huangdajun","phone","18997215972");
	if(0 < select_table_byname("huangdajun",&mem))
	printf("%d,%s,%s,%s,%s,%d,%d,%d,%d\n",mem.mem_no,mem.name,mem.passwd,mem.address,mem.phone,mem.permission,mem.age,mem.msg_flag,mem.salary);
	
	printf("\n\n\n");
	get_all_msg(&buf);
	printf("%s\n",buf);
	free_all_msg(buf);
	return 0;
}
